package com.zzb.projectfactory.framework.autodoc;


import com.zzb.projectfactory.framework.autodoc.bean.ConfigBean;
import com.zzb.projectfactory.framework.autodoc.constant.VersionType;

/**
 * 创建pdf
 * Created by zhangzhenbin on 2016/11/8.
 */

public class CreateDocumnetExecutor {

    private static ConfigBean buildConfigBean(){
        String filePath = "H:/program/js/element-starter/src/json/";
        String fileName = "jsonData";
        String projectName = "项目工厂";
        ConfigBean configBean = new ConfigBean();
        configBean.setCurrentVersion(VersionType.V100);
        configBean.setFilePath(filePath);
        configBean.setFileName(fileName);
        configBean.setShowDeprecated(true);
        configBean.setShowAllVersion(true);
        configBean.setRpcServer(false);
        configBean.setPrefix("");
        return configBean;
    }
//    private static void upload(){
//        String path = "/home/uftp/研发部/java/duoshihui";
//        String addr = "192.168.1.223";
//        int port = 21;
//        String userName = "uftp";
//        String password = "123456";
//        String file = "E:\\哆拾惠接口.pdf";
//        System.out.println(">>>>上传到["+addr+ path +"] ... ");
//        long currentTime = System.currentTimeMillis();
//        FtpUtils.upload(path,addr,port,userName,password,file,true);
//        System.out.println(">>>>上传完成，费时 " + (System.currentTimeMillis() - currentTime) + " ms");
//    }

    public static void main(String[] args) {
        System.out.println(DocHelper.SOURCEPATH);
        System.out.println(DocHelper.SERVER_PATH);
        DocHelper docHelper = new DocHelper();
        try {
            //创建接口文档
            docHelper.createDoc(buildConfigBean());
        //    upload();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
